home *** CD-ROM | disk | FTP | other *** search
/ How Would You Survive? / How Would You Survive (1995)(Grolier)[Mac-PC].iso / pc / credit.dir / 00002_Script_2 < prev    next >
Text File  |  1995-09-12  |  4KB  |  170 lines

  1. global PREF_PRESENT , gSysPath , gSysRam , gProjector , gCDPath
  2. --òò This file is used by both the Mac and Windows versions. It lives on the CD-ROM.
  3. --òò This file must: Display the credits and then make a determination as to if the
  4. --òò REGISTRATION Screen should be shown
  5.  
  6. on startMovie
  7.   set the exitLock = TRUE
  8.   set the colordepth = 8
  9.   testRamEnough()
  10.   -- init cursors
  11.   set the cursor of sprite 10 = [38,39]
  12.   set the cursor of sprite 11 = [38,39]
  13. end
  14.  
  15. on stopMovie
  16.   set the cursor of sprite 10 = -1
  17.   set the cursor of sprite 11 = -1
  18.   puppetsound 0
  19. end
  20.  
  21. on getPrefFileStatus
  22.   set sysPath =  gSysPath
  23.   if (the machineType >= 256) then
  24.     -- òòò PC / Windows machine 
  25.     openXLib sysPath & "FILEIO.DLL"
  26.     set myFile = FileIO(mNew , "read" , sysPath&"SPREF.TXT")
  27.   else
  28.     -- òòò MAC machine
  29.     --set sysPath = sysPath & "Preferences:"
  30.     if (gProjector = FALSE) then
  31.       --openXLib the pathName & "FileIO.XOBJ" 
  32.     end if
  33.     set myFile = FileIO(mNew , "read" , sysPath&"Survive Pref")
  34.   end if
  35.   
  36.   if (objectp(myFile) ) then
  37.     -- we got a file so we don't need to show the REG form again
  38.     set status = myFile(mStatus)
  39.     if (status = 0) then
  40.       set PREF_PRESENT = TRUE  
  41.     else
  42.       -- file not present so we will show REG form
  43.       set PREF_PRESENT = FALSE 
  44.     end if
  45.     myFile(mDispose)
  46.     if (the machineType >= 256) then
  47.       -- òòò PC / Windows machine 
  48.       closeXLib sysPath & "FILEIO.DLL"
  49.     else
  50.       -- òòò MAC machine
  51.       if (gProjector = FALSE) then
  52.         --closeXLib the pathName & "FileIO.XOBJ" 
  53.       end if
  54.     end if
  55.   else
  56.     -- file not present so we will show REG form
  57.     set PREF_PRESENT = FALSE 
  58.   end if 
  59.   return PREF_PRESENT
  60. end
  61.  
  62.  
  63. on disableRegForm 
  64.   set the trace = TRUE
  65.   set sysPath =  gSysPath
  66.   if (the machineType >= 256) then
  67.     -- òòò PC / Windows machine 
  68.     openXLib sysPath & "FILEIO.DLL"
  69.     set myFile = FileIO(mNew , "write" , sysPath&"SPREF.TXT")
  70.   else
  71.     -- òòò MAC machine
  72.     --set sysPath = sysPath & "Preferences:"
  73.     if (gProjector = FALSE) then
  74.       --openXLib the pathName & "FileIO.XOBJ" 
  75.     end if
  76.     set myFile = FileIO(mNew , "write" , sysPath&"Survive Pref")
  77.   end if
  78.   if (objectp(myFile) ) then
  79.     myFile( mWriteString ,  "HWYS CD-ROM")
  80.     myFile(mDispose) 
  81.     if (the machineType >= 256) then
  82.       -- òòò PC / Windows machine 
  83.       closeXLib sysPath & "FILEIO.DLL"
  84.     else
  85.       -- òòò MAC machine
  86.       set sysPath = sysPath & "Preferences:"
  87.       if (gProjector = FALSE) then
  88.         --closeXLib the pathName & "FileIO.XOBJ" 
  89.       end if
  90.     end if
  91.   end if
  92.   set the trace = FALSE
  93.   doSurvive
  94. end
  95.  
  96. on doSurvive
  97.   go movie gCDPath&"OPENING"
  98. end
  99.  
  100. on testButtonClick
  101.   set thisSprite = the clickOn
  102.   set thisCast = the castNum of sprite thisSprite
  103.   set the castNum of sprite thisSprite = thisCast + 1
  104.   upDateStage
  105.   repeat while (rollover(thisSprite) and the mouseDown)
  106.   end repeat
  107.   set the castNum of sprite thisSprite = thisCast
  108.   upDateStage
  109.   if (rollover(thisSprite)) then 
  110.     puppetSound "FeatureButSplClk.AIFF"
  111.     updatestage
  112.     set retCode = TRUE
  113.   else
  114.     set retCode = FALSE
  115.   end if
  116.   return retCode
  117. end
  118.  
  119. on doCredits
  120.   if (testButtonClick()) then
  121.     go "credits"
  122.   end if
  123. end
  124.  
  125. on doSkipCredits
  126.   if (testButtonClick()) then
  127.     if (getPrefFileStatus()) then
  128.       doSurvive
  129.     else
  130.       go "Register"
  131.     end if
  132.   end if
  133. end
  134.  
  135. on doNext
  136.   if (testButtonClick()) then
  137.     go marker(1)
  138.   end if
  139. end
  140.  
  141. on doTestReg
  142.   if (testButtonClick()) then
  143.     if (getPrefFileStatus()) then
  144.       doSurvive
  145.     else
  146.       go "Register"
  147.     end if
  148.   end if
  149. end
  150.  
  151.  
  152. on testRamEnough
  153.   if (the machineType >= 256)  then
  154.     -- Windows machine
  155.     -- test gSysRam agains min limit: gSysRam units are 1KBytes
  156.     if (gSysRam <  10*1024) then -- test 10 MB
  157.       set aStr = "Your system has insufficient memory available to run "
  158.       set aStr = aStr&"E&"How Would You Survive?""E
  159.       set aStr = aStr&" properly. For further information please see the "
  160.       set aStr = aStr"E&"Memory Issues""E
  161.       set aStr = aStr&" section of the README.TXT file on the "
  162.       set aStr = aStr&"How Would You Survive? CD-ROM."
  163.       --alert  aStr
  164.       set the text of cast 14 = aStr
  165.       go "showAlert"
  166.     end if
  167.   end if
  168. end
  169.  
  170.